]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Disable desaturation effect when not in use
authorSebastian Keller <skeller@gnome.org>
Mon, 8 Nov 2021 04:19:32 +0000 (05:19 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 8 Nov 2021 15:39:34 +0000 (15:39 +0000)
The desaturation effect was always enabled, regardless of the specified
factor. This was causing the magnifier to always hit offscreen
rendering, even when not necessary. Additionally offscreen rendering is
currently also causing glitches in MetaWindowGroup which this helps to
avoid in some cases.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1678
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2026>

js/ui/magnifier.js

index 180df25460f8ce45fcf3c2ae8ebd2e869e588b0e..2443248d34df0a4c72730d931c65dcad74e7667e 100644 (file)
@@ -1898,6 +1898,7 @@ var MagShaderEffects = class MagShaderEffects {
         this._colorDesaturation = new Clutter.DesaturateEffect();
         this._inverse.set_enabled(false);
         this._brightnessContrast.set_enabled(false);
+        this._colorDesaturation.set_enabled(false);
 
         this._magView = uiGroupClone;
         this._magView.add_effect(this._inverse);
@@ -1930,6 +1931,7 @@ var MagShaderEffects = class MagShaderEffects {
 
     setColorSaturation(factor) {
         this._colorDesaturation.set_factor(1.0 - factor);
+        this._colorDesaturation.set_enabled(factor !== 1.0);
     }
 
     /**